package org.dromara;

import cn.hutool.core.thread.ThreadUtil;
import org.dromara.web.thread.RotatingServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;

/**
 * 启动程序
 *
 * @author Lion Li
 */

@SpringBootApplication
public class DromaraApplication {

    public static RotatingServer  rotatingServer;

    @Autowired
    private void setThreadServer(RotatingServer rotatingServer)
    {
        DromaraApplication.rotatingServer = rotatingServer;

    }


    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(DromaraApplication.class);
        application.setApplicationStartup(new BufferingApplicationStartup(2048));
        application.run(args);
        ThreadUtil.execute(rotatingServer);
        System.out.println("(♥◠‿◠)ﾉﾞ  TunnelEquipmentServer启动成功   ლ(´ڡ`ლ)ﾞ");
    }

}


